<!DOCTYPE html>
<html lang="en">
<head>
    
    <meta charset="utf-8">
    <title>api/accounts.js - Documentation</title>
    
    
    <script src="scripts/prettify/prettify.js"></script>
    <script src="scripts/prettify/lang-css.js"></script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
  <div class="navicon"></div>
</label>

<label for="nav-trigger" class="overlay"></label>

<nav >
    
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="accountsApi.html">accountsApi</a><ul class='methods'><li data-type='method'><a href="accountsApi.html#create">create</a></li><li data-type='method'><a href="accountsApi.html#createAddress">createAddress</a></li><li data-type='method'><a href="accountsApi.html#listAddresses">listAddresses</a></li></ul></li><li><a href="queryApi.html">queryApi</a><ul class='methods'><li data-type='method'><a href="queryApi.html#getblockstatus">getblockstatus</a></li><li data-type='method'><a href="queryApi.html#listAsset">listAsset</a></li><li data-type='method'><a href="queryApi.html#listUTXO">listUTXO</a></li></ul></li><li><a href="transactionsApi.html">transactionsApi</a><ul class='methods'><li data-type='method'><a href="transactionsApi.html#buildPayment">buildPayment</a></li><li data-type='method'><a href="transactionsApi.html#buildTransaction">buildTransaction</a></li><li data-type='method'><a href="transactionsApi.html#convertArguement">convertArguement</a></li><li data-type='method'><a href="transactionsApi.html#list">list</a></li><li data-type='method'><a href="transactionsApi.html#submit">submit</a></li></ul></li></ul>
</nav>

<div id="main">
    
    <h1 class="page-title">api/accounts.js</h1>
    

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>/**
 * Represents a accountsApi.
 * @constructor
 */
function accountsApi(http) {
    this.http = http;
}


/**
 * Create a new account.
 *
 * @param {Object} params - Parameters for accounts create.
 * @param {String} params.pubkey - key pubkey,
 * @param {String} params.label  - Optional. Account alias.
 * @param {String} params.email - Optional. The account email
 * @returns {Promise} Guid, address, label
 */
accountsApi.prototype.create = function(params) {
    return this.http.request('account/create-account', params);
};

/**
 * Create a new address.
 *
 * @param {Object} params - Parameters for address create.
 * @param {String} params.guid - AccountID,
 * @param {String} params.label  - Optional. Account alias.
 * @returns {Promise} Guid, address, label
 */
accountsApi.prototype.createAddress = function(params) {
    return this.http.request('account/create-address', params);
};

/**
 * List all addresses for one account.
 * 
 * @param {String} Guid - id of account.
 * @returns {Promise} Array of Object, with Guid, Address, label, Balance.
 */
accountsApi.prototype.listAddresses = function(Guid) {
    return this.http.request('account/list-addresses', {Guid});
};

export default accountsApi;</code></pre>
        </article>
    </section>




    
    
</div>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Apr 29 2019 10:37:11 GMT+0800 (CST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>



</body>
</html>
